package com.zz.springrabbitmq.listener;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class TopicListener {
    // 监听topic.queue1队列
    @RabbitListener(queues = "topic.queue1")
    public void listener1(String message) {
        System.out.println("[topic.queue1]" + message);
    }
    // 监听topic.queue2队列
    @RabbitListener(queues = "topic.queue2")
    public void listener2(String message) {
        System.out.println("[topic.queue2]" + message);
    }
}
